package com.dsl.dslallinone.common.config;

import io.swagger.v3.oas.annotations.media.Schema;

import javax.validation.constraints.NotBlank;

/**
 * 过滤条件配置
 */
@Schema(description = "过滤条件配置")
public class FilterConfig {
    @Schema(description = "字段名", required = true, example = "energy_type")
    @NotBlank(message = "字段名不能为空")
    private String field;

    @Schema(description = "操作符", required = true, example = "eq",
            allowableValues = {"eq", "ne", "gt", "gte", "lt", "lte", "in", "like"})
    @NotBlank(message = "操作符不能为空")
    private String op;

    @Schema(description = "过滤值", example = "electric")
    private Object value;

    public FilterConfig() {}

    public FilterConfig(String field, String op, Object value) {
        this.field = field;
        this.op = op;
        this.value = value;
    }

    // Getters and Setters
    public String getField() { return field; }
    public void setField(String field) { this.field = field; }
    public String getOp() { return op; }
    public void setOp(String op) { this.op = op; }
    public Object getValue() { return value; }
    public void setValue(Object value) { this.value = value; }
}
